package com.linck.port.util;

/**
 * @program: AirPort
 * @description
 * @author: Linck
 * @create: 2020-06-14 19:31
 **/
public class ResultJson {

    public static final String ERROR_CODE = "A0001";

    public static final String SUCCESS_CODE = "00000";

    private String code;

    private Object data;

    private String msg;

    public ResultJson(String code, Object data, String msg) {
        this.code = code;
        this.data = data;
        this.msg = msg;
    }

    public static ResultJson success(Object data, String msg){
        return new ResultJson(ResultJson.SUCCESS_CODE, data ,msg);
    }

    public static ResultJson error(Object data, String msg){
        return new ResultJson(ResultJson.ERROR_CODE, data ,msg);
    }


    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}
